package com.woniu.controller;

import com.woniu.dto.DischargeRecordQueryDTO;
import com.woniu.service.IDischargeRecordService;
import com.woniu.utils.ResponseUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/discharge")
public class DischargeRecordController {
    @Resource
    private IDischargeRecordService dischargeRecordService;;
    @PostMapping("/list") // 1. 使用 @PostMapping
    public ResponseUtil list(@RequestBody DischargeRecordQueryDTO queryDTO) { // 2. 添加 @RequestBody
        ResponseUtil result = dischargeRecordService.listDischargeRecords(queryDTO);
        // 直接返回 PageInfo 对象
        return result;
    }

}
